#include <string.h>
#include <iostream>
using std::cout;
using std::endl;

//定义类名遵循大驼峰规则
struct Computer{
    //类提供给外界的接口，告知了可以进行哪些操作
    //定义成员函数名遵循小驼峰规则
	void setBrand(const char * brand)
	{
		strcpy(_brand, brand);
	}
    
	void setPrice(float price)
	{
		_price = price;
	}

    void print(){
        cout << "brand:" << _brand << endl;
        cout << "price:" << _price << endl;
    }
/* private: */  
    //定义数据成员名前面加上下划线
	char _brand[20];
	float _price;
};

void test0(){
    /* int a; */
    Computer pc;
    pc.setBrand("Xiaomi");
    pc.setPrice(5699);
    pc.print();
    cout << pc._price << endl;
    pc._price = 1;
    cout << pc._price << endl;

}

int main(void){
    test0();
    return 0;
}
